package com.ds.lens.data.vo.factory;

import com.ds.lens.data.vo.BaseOutVO;
import com.ds.lens.data.vo.enums.VoMessageEnum;

/**
 * Description
 *
 * @author nianjun
 * @create 2017-07-04 下午5:42
 **/
public class VOFactory {

    public static BaseOutVO getBaseOutVO(Integer code, String errorMessage) {
        BaseOutVO baseOutVo = new BaseOutVO();
        baseOutVo.setCode(code);
        baseOutVo.setMessage(errorMessage);

        return baseOutVo;
    }

    public static BaseOutVO getSuccessBaseOutVO() {
        BaseOutVO baseOutVo = new BaseOutVO();
        baseOutVo.setCode(VoMessageEnum.SUCCESS.getCode());
        baseOutVo.setMessage(VoMessageEnum.SUCCESS.getMessage());

        return baseOutVo;
    }

    public static BaseOutVO getSuccessBaseOutVO(Object data) {
        BaseOutVO baseOutVo = new BaseOutVO();
        baseOutVo.setCode(VoMessageEnum.SUCCESS.getCode());
        baseOutVo.setData(data);
        return baseOutVo;
    }

}
